package com.yvnze.ydyp.common.enums;

/**
 * @author HaiPeng Wang
 * @date 2021/8/13 16:36
 * @Description:定义所有错误码及其解释,code定义成不同种类的code
 */
public enum ErrorCodeEnum {


    /*Token：*/
    ERROR_TOKEN(401,"token错误"),

    /*Login:*/
    USER_PHONE_USED(501,"该手机号已注册"),
    USER_EMAIL_USED(501,"该邮箱已注册"),

    /*User:*/
    PHONE_CODE_ERROR(1003,"手机验证码错误"),
    USER_EXISTS(1004,"用户已存在"),
    PASSWORD_ERROR(1005,"用户名或密码错误"),
    PASSWORD_MORE_ERROR(1008,"密码错误次数太多"),
    USERNAME_ERROR(1006,"用户名错误"),
    USER_NO_ERROR(1006,"用户不存在"),

    /*Extra*/
    PARAM_ERROR(301,"参数错误"),


    /*Json*/
    JSON_TRANS_ERROR(601,"Json转换错误"),

    /*DataBase*/
    NO_DATA(302,"数据库无数据");



    private Integer code;
    private String msg;

    ErrorCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
